<div class="page-toolbar">
    <div class="layui-btn-group fl">
        <a href="{:url('add')}" class="layui-btn layui-btn-primary"><i class="aicon ai-tianjia"></i>添加</a>   
    </div>
</div>
<table id="dataTable"></table>
{include file="admin@block/layui" /}
<script type="text/html" title="操作按钮模板" id="buttonTpl">
    <a href="{:url('edit')}?id={{ d.id }}" class="layui-btn layui-btn-xs layui-btn-normal">修改</a>
    <a href="{:url('del')}?id={{ d.id }}" class="layui-btn layui-btn-xs layui-btn-danger j-tr-del">删除</a>
</script>
<script type="text/javascript">
    layui.use(['table'], function() {
        var table = layui.table, formType = {:json_encode(form_type())};
        table.render({
            elem: '#dataTable'
            ,url: '{:url('')}' //数据接口
            ,page: true //开启分页
            ,limit: 20
            ,text: {
                none : '暂无相关数据'
            }
            ,cols: [[ //表头
                {type:'checkbox'}
                ,{field: 'areaname', title: '图书馆区域', width: 400}
                ,{field: 'starttime', title: '闭馆开始时间', width: 200}
                ,{field: 'endtime', title: '闭馆结束时间', width: 200}
                ,{title: '操作', width: 120, templet: '#buttonTpl'}
            ]]
        });
    });
</script>